home *** CD-ROM | disk | FTP | other *** search
- *****Listing 2*****
-
- #include <stdio.h>
-
- extern int output_location;
-
- #define SCREEN 0
- #define PORTRAIT 1
- #define LANDSCAPE 2
-
- /************************************************************
- * init_printer() - initialize output device
- *
- * global
- * output_location (in) - SCREEN, PORTRAIT,
- * or LANDSCAPE
- *
- * Notes:
- * 1. Compiled with Turbo C compiler version 2.0
- * 2. This version does nothing if output is to the
- * screen.
- *
- * History
- * Original code William H. Roetzheim, 1990
- **************************************************************/
-
- void init_printer()
- {
- if (output_location != SCREEN)
- {
- /* reset the printer */
- fprintf(stdprn, "\033E");
-
- /* select proper orientation */
- if (output_location == LANDSCAPE)
- {
- /* landscape */
- fprintf(stdprn, "\033&l1O");
- }
- else fprintf(stdprn, "\033&l0O");
-
- /* select 300 DPI resolution */
- fprintf(stdprn, "\033*t300R");
-
- /* select default font */
- fprintf(stdprn,"\033(10U"); /* PC symbol set */
- fprintf(stdprn,"\033(s16.66H"); /* 16.66 cpi */
- fprintf(stdprn,"\033(s0T"); /* lineprinter */
- }
- }
-
-